package grad.nxu.recruitsystem.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import grad.nxu.recruitsystem.domain.Position;
import grad.nxu.recruitsystem.mapper.PositionMapper;
import grad.nxu.recruitsystem.service.PositionService;
import grad.nxu.recruitsystem.vo.PositionVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author HAPPY
 * @description 针对表【position】的数据库操作Service实现
 * @createDate 2023-03-10 18:07:37
 */
@Service
public class PositionServiceImpl extends ServiceImpl<PositionMapper, Position>
        implements PositionService {

    @Autowired
    PositionMapper positionMapper;

    @Override
    public List<PositionVO> getAll(Integer pageSize, Integer pageNumber) {
        Integer offset = (pageNumber - 1) * pageSize;
        return positionMapper.getAll(pageSize, offset);
    }

    @Override
    public boolean insertPosition(Position position) {
        return positionMapper.insertPosition(position);
    }
}




